$NG.AllReady(function (page, { useValuesChange,useDataIndexChange,useUpdateRows,useUpdateRow }) {
    const mstform = $NG.getCmpApi("p_form_ndsrjhhz")  
    const dgrid = $NG.getCmpApi("p_form_ndsrjhhz_d")  
    if(page.oType == 'add'){
        console.log(mstform.getValues());
        const org = mstform.getValues().phid_org
        const org_EXName = mstform.getValues().phid_org_EXName
        $NG.updateState((updater)=>{
            updater.data.p_form_ndsrjhhz.setProps({
                u_syb:{
                    label:org_EXName,
                    value:org
                }
            })
        })
        getYearPayPlan()
    }
    useValuesChange(({args})=>{
        getYearPayPlan()
    },"p_form_ndsrjhhz.u_syb")
    useValuesChange(({args})=>{
        getYearPayPlan()
    },"p_form_ndsrjhhz.u_nd")
    /**
     * 功能扩展
     * 
    */
   function getYearPayPlan(){
    const org = mstform.getItem("u_syb").getValue()
    const nd = mstform.getItem("u_nd").getValue()
    if(!org||!nd) return
    $NG.execServer("getYearPayPlan",{org:org,nd:nd},(res)=>{
        console.log(res,org,nd);
        if(res.count ==0) return 
        const _data = JSON.parse(res.data)
        const _tempArr = []
        _data.forEach(items=>{
            const item = items.extendObjects
            console.log(item.c_name,item);
            _tempArr.push({
                phid_pc:item.phid_pc,
                phid_pc_EXName:item.bill_name,
                u_hth:item.u_hth,
                u_qyzx:item.u_qyzx,
                u_cpx:item.u_cpx,
                u_cpx_EXName:item.c_name,
                u_fl:item.u_fl,
                u_qd_rq:item.u_qdrq,
                u_sfjtnbxm:item.u_sfnbxm,
                u_1y:item.u_yy,
                u_2y:item.u_ey,
                u_3y:item.u_sy,
                u_4y:item.u_siyue,
                u_5y:item.u_wy,
                u_6y:item.u_ly,
                u_7y:item.u_qy,
                u_8y:item.u_by,
                u_9y:item.u_jiuyue,
                u_10y:item.shiyue,
                u_11y:item.u_syy,
                u_12y:item.u_sey
            })
        })
        dgrid.clearRows().then(()=>{
            dgrid.addRows(_tempArr)
            dgrid.refreshView()
        })
    })
   }
})